<?php

namespace app\models;

use Yii;
use yii\base\Model;

class Users
{
    /**
     * @param $formData
     * @return int
     * @throws \yii\db\Exception
     * 1成功0失败
     */
	public static function loginadd($formData){
        $time = date('Y-m-d H:i:s', time());
        $result = Yii::$app->db->createCommand()->insert('users', [
            'u_name' => $formData['u_name'],
            'u_pwd' => md5($formData['u_pwd']),
            'u_tel' => $formData['u_tel'],
            'u_email' => $formData['u_email'],
            'u_address' => $formData['u_address'],
            'u_age' => $formData['u_age'],
            'u_create_at' => $time
        ])->execute();
        return $result?1:0;
    }
}